package company.guazi.question;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.junit.Test;

/**
 * @author jiangwz
 * @create 2019/11/6.
 */
public class Test01 {

//    输入例子1:
//    It's a dog!
//
//    输出例子1:
//    dog! a It's
    @Test
    public void test01(){

        String str = "It's a dog!";
        List<String> strings = Arrays.asList(str.split(" "));
        Collections.reverse(strings);
        for (String string : strings) {
            System.out.print(string+" ");
        }

    }
    public static void main(String[] args){
        String str = "It's a dog!";
        List<String> strings = Arrays.asList(str.split(" "));
        Collections.reverse(strings);
        for (String string : strings) {
            System.out.print(string+" ");
        }
    }
}
